package tmproject.hlhj.fhp.tmvote.presenters

import android.content.Context
import com.example.mymvp.BasePresenter
import tmproject.hlhj.fhp.tmvote.BaseAty
import tmproject.hlhj.fhp.tmvote.beans.BaseBean
import tmproject.hlhj.fhp.tmvote.beans.SignUpRuleBean
import tmproject.hlhj.fhp.tmvote.module.SignUpModule
import tmproject.hlhj.fhp.tmvote.views.SignUpView
import java.io.File

/**
 * Created by Never Fear   on 2018\8\7 0007.
Never More....
 */
class SignUpPresenter : BasePresenter<SignUpModule, SignUpView>(), SignUpModule.OnSignUpListener {
    fun signUp(user_id:String, competitor_name:String, phone:String, profile:String, activity_id:String,
               pay_way:String?, avatar: File, context: Context){
        module?.signUp(user_id, competitor_name, phone, profile, activity_id, pay_way, avatar, context)

    }

    fun getSignUpRule(){
        module?.getRuleData()
    }

    override fun createModule() {
        module= SignUpModule()
        module.listener=this
    }

    override fun onSignUpResp(baseBean: BaseBean) {
        view?.signUp(baseBean)
    }

    override fun onSignUpRuleResp(signUpRuleBean: SignUpRuleBean) {
        view?.setVoteRule(signUpRuleBean)
    }

    override fun onSignAgain(baseBean: BaseBean) {
    }

    fun uploadImg(){
        view?.upLoadImg()
    }
}